const state = {
	sceneData: {
		sceneName: '',
		id: '',
		createdAt: '',
		createdUserId: '',
		sceneStatus: ''
	},
	// 场景列表
	sceneList: [],
	// 当前绑定人工坐席工作流
	agentWorkFlow: [],
	// AI 工作流 ID
	aiBizflow: null,
	// 人工工作流 ID
	humanBizflow: null,
	// 绑定只能租
	agentGroup: [],
	// 表单
	form: [],
	// 派工规则
	schedPolicy: {},
	// 当前业务场景启/停状态
	currentSceneStatus: false,
	// 用户自定义派工规则
	customizedPolicy: [],
	// 默认派工规则
	defaultPolicy: 'least-used',
	// 技能组列表
	groupList: []
};

const mutations = {
	SET_SCENE_DATA(target, data) {
		target.sceneData.sceneName = data.sceneName;
		target.sceneData.id = data.id;
		target.sceneData.createdAt = data.createdAt;
		target.sceneData.createdUserId = data.createdUserId;
		target.sceneData.sceneStatus = data.sceneStatus;
	},
	SET_SCENE_LIST(target, list) {
		target.sceneList = JSON.parse(JSON.stringify(list));
	},
	SET_AGENT_WORK_FLOW(target, workFlow) {
		target.agentWorkFlow = JSON.parse(JSON.stringify(workFlow));
	},
	SET_AI_BIZ_FLOW(target, id) {
		target.aiBizflow = id;
	},
	SET_HUMAN_BIZ_FLOW(target, id) {
		target.humanBizflow = id;
	},
	SET_AGENT_GROUP(target, group) {
		target.agentGroup = JSON.parse(JSON.stringify(group));
	},
	SET_AGENT_FORM(target, form) {
		target.form = JSON.parse(JSON.stringify(form));
	},
	SET_SCHED_POLICY(target, policy) {
		target.schedPolicy = JSON.parse(JSON.stringify(policy));
	},
	SET_SCENE_STATUS(target, status) {
		target.currentSceneStatus = status;
	},
	SET_CUSTOMIZED_POLICY(target, policy) {
		target.customizedPolicy = policy;
	},
	SET_DEFAULT_POLICY(target, defaultPolicy) {
		target.defaultPolicy = defaultPolicy;
	},
	SET_GROUP_LIST(target, list) {
		target.groupList = list;
	}
};

const getters = {};

const action = {};

export default {
	state,
	mutations,
	getters,
	action
};
